<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<canvas id="canvas" width="400" height="400">
    此浏览器不支持canvas
</canvas>
</body>
</html>

<script>
    const ctx = document.getElementById('canvas')

    const gl = ctx.getContext('webgl')

    // 整体更改为红色
    gl.clearColor(1.0, 0.0, 0.0, 1.0) // 清空颜色，red=1.0,green=0.0,blue=0.0,alpha=1.0
    gl.clear(gl.COLOR_BUFFER_BIT)

</script>
